package com.mida.dms.knw.entity;

import java.io.Serializable;
import java.util.Date;


import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;


/**
 * 模型属性
 * @author conyfrommars
 *
 */
@Setter
@Getter
@ToString
public class DtModelProperty implements Serializable {

    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long soid;

    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long dataModelSoid;

    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long dataSourceSoid;

    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long codingSystemSoid;

    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long isPrimaryKey;

    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long isForeignKey;

    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long isNull;

    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long isEncrpytion;

    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long isPrivate;

    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long status;

    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long isDelete;

    private Date createDate;

    private Date updateDate;

    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long updateUser;

    @JsonSerialize(using= com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    private Long psotion;
    
    
    /**
     * 默认值
     */
    private String defaultNumber;

    /**
     * 最大值
     */
    private Double maxMunber;

    /**
     * 最小值
     */
    private Double minMunber;
    
    /**
     * 数据元类型
     */
    private Long dataType;

    /**
     * 备用字段1
     */
    private Long cusmon1;

    /**
     * 备用字段2
     */
    private Long cusmon2;

    private String format;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof DtModelProperty)) return false;

        DtModelProperty that = (DtModelProperty) o;

        if (getDataSourceSoid() != null ? !getDataSourceSoid().equals(that.getDataSourceSoid()) : that.getDataSourceSoid() != null)
            return false;
        if (getCodingSystemSoid() != null ? !getCodingSystemSoid().equals(that.getCodingSystemSoid()) : that.getCodingSystemSoid() != null)
            return false;
        if (getIsPrimaryKey() != null ? !getIsPrimaryKey().equals(that.getIsPrimaryKey()) : that.getIsPrimaryKey() != null)
            return false;
        if (getIsForeignKey() != null ? !getIsForeignKey().equals(that.getIsForeignKey()) : that.getIsForeignKey() != null)
            return false;
        if (getIsNull() != null ? !getIsNull().equals(that.getIsNull()) : that.getIsNull() != null) return false;
        if (getIsEncrpytion() != null ? !getIsEncrpytion().equals(that.getIsEncrpytion()) : that.getIsEncrpytion() != null)
            return false;
        return getIsPrivate() != null ? getIsPrivate().equals(that.getIsPrivate()) : that.getIsPrivate() == null;
    }

    @Override
    public int hashCode() {
        int result = getDataSourceSoid() != null ? getDataSourceSoid().hashCode() : 0;
        result = 31 * result + (getCodingSystemSoid() != null ? getCodingSystemSoid().hashCode() : 0);
        result = 31 * result + (getIsPrimaryKey() != null ? getIsPrimaryKey().hashCode() : 0);
        result = 31 * result + (getIsForeignKey() != null ? getIsForeignKey().hashCode() : 0);
        result = 31 * result + (getIsNull() != null ? getIsNull().hashCode() : 0);
        result = 31 * result + (getIsEncrpytion() != null ? getIsEncrpytion().hashCode() : 0);
        result = 31 * result + (getIsPrivate() != null ? getIsPrivate().hashCode() : 0);
        return result;
    }

    private static final long serialVersionUID = 1L;

  
}